{{- if .Params.outdatedArticleReminder.enable | default .Site.Params.page.outdatedArticleReminder.enable | default false -}}
    {{- $daysAgo := div (sub now.Unix .Lastmod.Unix) 86400 }}
    {{- $reminderThreshold := .Params.outdatedArticleReminder.reminder | default .Site.Params.page.outdatedArticleReminder.reminder | default 90 }}
    {{- $warningThreshold := .Params.outdatedArticleReminder.warning | default .Site.Params.page.outdatedArticleReminder.warning | default 180 }}
    {{- $updateTime := .Lastmod }}
    {{- if .GitInfo }}
        {{- if lt .GitInfo.AuthorDate.Unix .Lastmod.Unix }}
            {{- $updateTime := .GitInfo.AuthorDate }}
        {{- end }}
    {{- end -}}

    {{- if gt $daysAgo $reminderThreshold }}
        {{- $iconDetails := "fas fa-angle-right fa-fw" -}}
        {{- $dateFormat := .Site.Params.dateformat | default "2006-01-02" -}}
        {{- if gt $daysAgo $warningThreshold }}
            {{- $type := "warning" -}}
            {{- $icon := "fas fa-exclamation-triangle fa-fw" -}}
            <div class="details admonition {{ $type }} open">
                <div class="details-summary admonition-title">
                    <i class="icon {{ $icon }}{{ $type }}"></i>{{ T $type }}<i class="details-icon {{ $iconDetails }}"></i>
                </div>
                <div class="details-content">
                    <div class="admonition-content">
                        {{ T "outdatedInfoWarningBefore" -}}
                        <span class="timeago" datetime="{{ dateFormat "2006-01-02T15:04:05" $updateTime }}" title="{{ dateFormat "January 2, 2006" $updateTime }}">
                        {{- dateFormat $dateFormat $updateTime -}}
                        </span>{{ T "outdatedInfoWarningAfter" -}}
                    </div>
                </div>
            </div>
        {{- else }}
            {{- $type := "note" -}}
            {{- $icon := "fas fa-pencil-alt fa-fw" -}}
            <div class="details admonition {{ $type }} open">
                <div class="details-summary admonition-title">
                    <i class="icon {{ $icon }}{{ $type }}"></i>{{ T $type }}<i class="details-icon {{ $iconDetails }}"></i>
                </div>
                <div class="details-content">
                    <div class="admonition-content">
                        {{ T "outdatedInfoWarningBefore" -}}
                        <span class="timeago" datetime="{{ dateFormat "2006-01-02T15:04:05" $updateTime }}" title="{{ dateFormat "January 2, 2006" $updateTime }}">
                        {{- dateFormat $dateFormat $updateTime -}}
                        </span>{{ T "outdatedInfoWarningAfter" -}}
                    </div>
                </div>
            </div>
        {{- end }}
    {{- end -}}
{{- end -}}
